package com.freshfresh.adapter;

import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;

public class BaseVPAdapter<T> extends PagerAdapter
{
  protected OnCustomListener listener;
  protected Context mContext;
  protected ArrayList<T> mList;

  protected BaseVPAdapter(Context paramContext)
  {
    this.mContext = paramContext;
  }

  protected BaseVPAdapter(ArrayList<T> paramArrayList)
  {
    this.mList = paramArrayList;
  }

  protected BaseVPAdapter(ArrayList<T> paramArrayList, Context paramContext)
  {
    this.mList = paramArrayList;
    this.mContext = paramContext;
  }

  public void destroyItem(ViewGroup paramViewGroup, int paramInt, Object paramObject)
  {
    paramViewGroup.removeView((View)paramObject);
  }

  public int getCount()
  {
    if (this.mList == null)
      return 0;
    return this.mList.size();
  }

  public boolean isViewFromObject(View paramView, Object paramObject)
  {
    return paramView == paramObject;
  }

  public void setOnCustomListener(OnCustomListener paramOnCustomListener)
  {
    this.listener = paramOnCustomListener;
  }
}